package com.ruoyi.oos.web.controller.overrun;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.oos.overrun.service.IOverrunRecordCalSelfService;
import com.ruoyi.oos.overrun.service.IOverrunRecordCalService;
 

@Component("taskCal")
public class TaskCalAction {
	
	 @Autowired
	 IOverrunRecordCalService overrunRecordCalService;
	 
	 @Autowired
	 IOverrunRecordCalSelfService overrunRecordSelfService;
	
	 //
	 @RequestMapping(value="calDataJson",method=RequestMethod.POST)
	 @ResponseBody
	 public String calDataJson() {
				Date curDate1 =new Date();
				 overrunRecordCalService.calOverrunRecord(DateUtils.addMinutes(curDate1, -10),1L);
		 return "success";
	 }
	 
	 //
	 @RequestMapping(value="calDataSelfJson",method=RequestMethod.POST)
	 @ResponseBody
	 public String calDataSelfJson(String beginTime,String endTime) {
		 
				overrunRecordSelfService.calOverrunRecordSelf(beginTime,endTime,1L);
		 return "success";
	 }
	 
	 
	 
	 public String testCalTask() {
		 System.out.println("nihao. 我今年8岁了");
		 return null;
	 }
	
	

}
